std::copysign

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

float       copysign( float x, float y );
(C++0x feature)
double      copysign( double x, double y );
(C++0x feature)
long double copysign( long double x, long double y );
(C++0x feature)

Composes a floating point value with the magnitude of x and the sign of y.

Parameters

x, y - floating point values

Return value

floating point value with the magnitude of x and the sign of y

See also

abs(float)
fabs
absolute value of an absolute value of an floating point value
(function)
signbit (C++0x)
checks if the given number is negative
(function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages